<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/includes/config.inc.php');
include_once("config.php");
if (isset($_POST['uname']) and isset($_POST['pword'])) {

	#CHECK PASSWORD
	Ldap::bindAsAdmin();
	$imm = Ldap::getImmutableIdFromPdsLoginId($_POST["uname"]);
	if (@Ldap::attemptBind($imm,$_POST["pword"])) {
		$sql = "INSERT INTO `tbLogins` VALUES(null, :uname, 'Successful login', :date, :time)";
		db::Query($sql, array(':uname'=>$_POST['uname'], ':date'=>date("n/j/Y"), ':time'=>date("g:i A")));
		$_SESSION["username"] = $_POST["uname"];
		$_SESSION["MM_Password"] = $_POST["pword"];
		header("Location: index.php");
	} else {
		$msg = "Our apologies, but your password could not be verified.<br/>Please try again or reset it <a href=\"https://www.edison.edu/portal/account\">here</a>.";
	}
}
$NEWTEMPLATE = true;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Edison IT Portal Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/menu.css" rel="stylesheet" type="text/css" />
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="all" href="css/sexyalertbox.css"/>
<link rel="stylesheet" type="text/css" media="all" href="css/jquery.timepickr.css"/>
<link rel="stylesheet" type="text/css" media="all" href="css/jquery.tooltip.css"/>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="http://jquery-utils.googlecode.com/svn/trunk/src/jquery.anchorHandler.js"></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="js/highcharts.js"></script>
<script type="text/javascript" src="js/sexyalertbox.v1.2.jquery.js"></script>
<script type="text/javascript" src="js/jquery.ui.all.js"></script> 
<script type="text/javascript" src="js/jquery.tooltip.js"></script> 
<script type="text/javascript" src="js/jsnow.js"></script>
<script type="text/javascript" src="js/menu.js"></script>

<style>
.box2, .box, .list2{
	background-color:#FFFFFF;
}
<?php if($NEWTEMPLATE){ ?>
body{
	background-image:url(images/pattern_062.gif);
	background-repeat:repeat;
	padding:0px;
}

#header{
	height:auto;
}

.row-1{
	text-align:center;
	margin:0px;
	margin-bottom:-35px;
	padding:0px;
	height:auto !important;
}

.fleft {
	padding:0px;
	margin:0px;
}

.fright {
	height: 1px;
	padding:0px;
}

#content{
	padding-left: 20px;
	padding-right:20px;
}

.box{
	border:1px #666 solid !important;
	padding-top:0px;
}

#boxcontent{
	padding-left: 5px;
	padding-right:5px;
}

.box h3, .box h1{
	font-size:18px;
	font-family:Arial, Helvetica, sans-serif;
	font-weight:bold;
	color:#000;
	border:none;
	border-bottom:1px #666 solid;
	background-color:#CCC;
	margin-top:0px;
	text-align:center;
	width:auto;
	padding-top:5px;
	padding-bottom:-5px;
}

.box h1{
	margin-left:-5px;
	margin-right:-5px;
}
<?php } ?>
</style>
</head>
<body id="page1">
<div id="main-width">
  <div id="main">
    <!-- header -->
    <div id="header" class="png">
      <div class="row-1">
        <div class="fleft">
        	<img alt="" height="60" src="images/logo.png" class="png" />
            <div class="messagebox" style="margin-top:5px;">
            	<strong style="font-size:12px; color:#000">
                	Welcome, Please login!<br/>
					<?php echo date("l").", ".date("F j, Y") ?><br/>
                    Current Weather Conditions: <?php echo getWeather(); ?>
                </strong>
            </div>
        </div>
        <div class="fright">
        </div>
      </div>
      <div class="row-2">
      <div id="copyright" style="display:none">Copyright &copy; 2011 <a href="http://apycom.com/">Apycom jQuery Menus</a></div>

        <div id="menu">
	    <ul class="menu">
        <li><a href=""><span>TSC Portal Login</span></a></li>
    </ul>
</div>
      </div>
    </div>
    <!-- content -->
    <div id="content">
      <div class="wrapper">
        <div class="sidebar">
          <div class="indent">
            <div class="widget">
              <div class="box">
              	<h3>Current Announcements</h3>
                	<ul class="list1">
                         <li>
                         	There are no announcements currently.
                         </li>
                    </ul>
               </div>
            </div>
            
          </div>
        </div>
        <div class="center">
          <div class="extra-wrap">
            <div class="wrapper">
              <div class="col-1" style="width:100%">
                <div class="extra-wrap">
                  <!-- box2 begin -->
                  <?php if($msg != NULL){?>
                  <div class="error">
	              		<?php echo $msg ?>
                  </div>
                  <?php } ?>
<div class="box">
<div id="boxcontent">
<form action="login.php" method="post">
<h1>TSC Portal Login</h1>
        <center>
        <strong style="font-size:20px">
		Username:<br/>
        <input name="uname" type="text" style="width:349px; height:35px; background-image:url(images/login_txt.png); border:none; background-color:transparent; font-family:Tahoma; font-size:24px; font-weight:bold; padding-left:3px;">
        
		<br/><br/>
        
		Password:<br/>
        <input name="pword" type="password" style="width:349px; height:35px; background-image:url(images/login_txt.png); border:none; background-color:transparent; font-family:Tahoma; font-size:24px; font-weight:bold; padding-left:3px;">
        
		<br/><br/>
        </strong>
		<input type="submit" style="background-image:url(images/login_btn.png); width:180px; height:42px; border:none; cursor:pointer; background-color:transparent" value="">
        <br/><br/>
        </center>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</body>